﻿using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Reflection;
using System.Xml;

namespace Xom.Elements
{
    //todo description
    public interface IXomElement : INotifyPropertyChanged
    {
        /// <summary>
        /// XmlNode that contains the root informations
        /// </summary>
        IXomNode RootNode { get; set; }

        /// <summary>
        /// List of all property informations
        /// </summary>
        IDictionary<string, IXomPropertyInfo> Properties { get; set; }

        /// <summary>
        /// Wrap Event for all CollectionChangedEvents
        /// </summary>
        event NotifyXomCollectionChangedEventHandler XomCollectionChanged;
    }

    public interface IXomPropertyInfo
    {
        PropertyInfo Info { get; set; }
    }

    public interface IXomPropertyInfo<T> : IXomPropertyInfo
    {
        IXomNode<T> Node { get; set; }
    }

    public interface IXomNode
    {   
    }

    public interface IXomNode<T> : IXomNode
    {
        /// <summary>
        /// Represents a single node in the XML document.
        /// </summary>
        T Value { get; set; }
    }

    /// <summary>
    /// Added a Sender property to NotifyCollectionChangedEvent
    /// </summary>
    /// <param name="sender">Parent of the Property</param>
    /// <param name="propertyName">Name of the Collection</param>
    /// <param name="notifyCollectionChangedEventArgs">ChangedEventArguments</param>
    public delegate void NotifyXomCollectionChangedEventHandler(IXomElement sender, string propertyName, NotifyCollectionChangedEventArgs notifyCollectionChangedEventArgs);

}
